home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / language / embedded / develop / ad2mac.arc / TEST05.ASM < prev    next >
Assembly Source File  |  1989-07-26  |  2KB  |  120 lines

  1.     ttl    Test Program for AD2MAC - 07/25/89
  2. *  Test Program for AD2MAC Utility
  3. *  Extracts symbol info from 2500AD cross 6805 assembler
  4. *  listing file (.LST) and produces HDS-300 compatible
  5. *  macro file (.MAC) containing local symbol (LS) commands.
  6. *
  7. *  BY:  Peter S. Gilmour    25 July 1989
  8.  
  9. control    equ    $103
  10. srmask    equ    $80
  11. fcbase    equ    $204
  12. stmask    equ    $40
  13. pattern    equ    $aa
  14. shram    equ    $200
  15. jmp1    equ    $307
  16. jmp1_addr equ    jmp1+$1c
  17.  
  18.     .absolute
  19.     org    $50
  20. count    rmb    1        Command count
  21.     .relative
  22.     org    shram
  23.     rmb    $20
  24. addr    rmb    2        Command address
  25. get    rmb    2        Get data address
  26. data    rmb    80        Command data
  27.     page
  28.  
  29.     org    $800
  30.  
  31. * Here for power up/reset:
  32. start    lda    control
  33.     and    #stmask        If not power up, then
  34.     beq    config        .  enter exec via config cmd!
  35.  
  36. * Here for self-test:
  37. stest    ldx    #0
  38.     lda    #pattern
  39. st_100    sta    shram,x        Test 1st page of shared ram.
  40.     cmp    shram,x
  41.     bne    st_err1        Exit if error!
  42.     coma            Get inverse pattern
  43.     bpl    st_100        and test same location again!
  44.     inx
  45.     beq    st_100        Continue until entire page is tested!
  46.  
  47.     bra    exec        Enter executive loop.
  48.  
  49. * Here for self-test error:
  50. st_err1 lda    #shram/256
  51.     bra    *        Hang the system.
  52.     page
  53.  
  54. * Here for config command:
  55. config    lda    control
  56.     sta    shram
  57.     nop
  58. * Fall into the exec loop!
  59.  
  60. * Here for the executive command loop:
  61. exec    rsp            Reset stack pointer.
  62.     lda    control
  63.     ora    #srmask
  64.     sta    control        Yield shared ram to FIM.
  65.  
  66. ex$wait    lda    control
  67.     and    #srmask
  68.     bne    ex$wait        Wait for FIM to return shared ram.
  69.  
  70.     lda    fcbase        Get cmd word and verify it, else
  71.     bne    exec        .  ignore it!
  72.     lda    fcbase+1
  73.     cmp    #maxfc+1
  74.     bhs    exec
  75.  
  76.     lsla
  77.     tax
  78.     lda    ftabl,x        Get addr of proper routine from table
  79.     sta    jmp1_addr    and place into JUMP address due to
  80.     lda    ftabl,x        6805 8-bit index register!
  81.     sta    jmp1_addr+1
  82.     jsr    jmp1        Go execute the command.
  83.     bra    exec        Return to exec loop.
  84.  
  85. ftabl    fdb    rduser
  86.     fdb    wruser
  87. maxfc    equ    ((*-ftabl)/2)-1        Maximum legal function code
  88.     page
  89.  
  90. * Here for read user memory command:
  91. rduser    jsr    cmd.init
  92.  
  93. rduser1 lda    0,x
  94.     sta    data
  95.     inx
  96.     inc    count
  97.     bne    rduser1
  98.  
  99.     rts
  100.  
  101. * Here for write user memory command:
  102. wruser    jsr    cmd.init
  103.  
  104. wruser1 lda    data
  105.     sta    ,x
  106.     inx
  107.     inc    count
  108.     bne    wruser1
  109.  
  110.     rts
  111.  
  112. * Subr. to init for command execution:
  113. cmd.init lda    addr
  114.     sta    get
  115.     lda    addr+1
  116.     sta    get+1
  117.     rts
  118.  
  119.     end
  120.